export const constructAnnouncementCallback = function ({result, bufferSuccess}) {
  var resultName
  var pointObj = new Array()
  for (
    var i = 0;
    i < result.feature.getGeometry().getCoordinates().length;
    i++
  ) {
    var pointGeo = new Zondy.Object.Point2D(
      result.feature.getGeometry().getCoordinates()[i][0],
      result.feature.getGeometry().getCoordinates()[i][1]
    )
    pointObj.push(pointGeo)
  }
  var gArc = new Zondy.Object.Arc(pointObj)
  //构成线的折线
  var gAnyLine = new Zondy.Object.AnyLine([gArc])
  //设置线要素的几何信息
  var gline = new Zondy.Object.GLine(gAnyLine)
  //设置要素的几何信息
  var fGeom = new Zondy.Object.FeatureGeometry({ LinGeom: [gline] })
  //设置属性结构
  var regAttStr = new Zondy.Object.CAttStruct({
    FldName: ['ID', '面积', '周长', 'LayerID'],
    FldNumber: 4,
    FldType: ['FldLong', 'FldDouble', 'FldDouble', 'FldLong'],
  })
  //实例化CAttDataRow类
  var values = [0, 62.566714, 50.803211, 0]
  var valuesRow = new Zondy.Object.CAttDataRow(values, 1)
  //实例化FeatureBuffBySingleRing类，设置要素缓冲分析必要参数，输出分析结果到缓冲分析结果图层
  var featureBufBySR = new Zondy.Service.FeatureBuffBySingleRing({
    ip: 'localhost',
    port: '6163',
    //设置要素缓冲分析左半径
    leftRad: 0.002,
    //设置要素缓冲分析右半径
    rightRad: 0.002,
  })
  /*设置缓冲分析参数*/
  //设置几何信息
  featureBufBySR.sfGeometryXML = JSON.stringify([fGeom])
  //设置属性结构
  featureBufBySR.attStrctXML = JSON.stringify(regAttStr)
  //设置属性值
  featureBufBySR.attRowsXML = JSON.stringify([valuesRow])
  //设置追踪半径
  featureBufBySR.traceRadius = 0.0001
  //设置缓冲结果的名称以及存放地址
  featureBufBySR.resultName =
    'gdbp://MapGisLocal/wuhan/ds/buffer/sfcls/bufferresult' + Date.now()
  resultName = featureBufBySR.resultName
  //调用Zondy.Service.AnalysisBase基类的execute方法执行要素缓冲分析，AnalysisSuccess为回调函数。
  // startPressBar()
  featureBufBySR.execute(bufferSuccess, 'post', false, 'json', bufferError)
  function bufferError() {
    console.log('错误')
  }
  // console.log(result);
  // result=store.fbggdata
  // console.log(store.fbggdata);
  
}
